import request from "@/utils/request";

//会员卡列表
export function listMember(query) {
  return request({
    url: "/system/member/list",
    method: "get",
    params: query,
  });
}
//规则列表
export function listMemberRule(query) {
  return request({
    url: "/system/member/rule/list",
    method: "get",
    params: query,
  });
}

//会员卡详情
export function getMember(id) {
  return request({
    url: "/system/member/" + id,
    method: "get",
  });
}
export function getMemberContinue(id) {
  return request({
    url: "/system/member/continue/" + id,
    method: "get",
  });
}
// /system/member/continue/{id}

export function addMember(data) {
  return request({
    url: "/system/member",
    method: "post",
    data: data,
  });
}

export function getMemberInfo(data) {
  return request({
    url: "/system/member/getMemberInfo",
    method: "post",
    data: data,
  });
}

export function addMemberContinueCard(data) {
  return request({
    url: "/system/member/continueCard ",
    method: "post",
    data: data,
  });
}

export function updateMember(data) {
  return request({
    url: "/system/member",
    method: "put",
    data: data,
  });
}

export function delMember(id) {
  return request({
    url: "/system/member/" + id,
    method: "delete",
  });
}

export function listMemberRegion(query) {
  return request({
    url: "/system/region/addList",
    method: "get",
    params: query,
  });
}
export function listMemberStore(query) {
  return request({
    url: "/system/store/allList",
    method: "get",
    params: query,
  });
}
export function listMemberUser(query) {
  return request({
    url: "/system/zy/user/getUserList",
    method: "get",
    params: query,
  });
}

export function listtechnicianList(query) {
  return request({
    url: "/system/item/technician/technicianList",
    method: "get",
    params: query,
  });
}
export function listnormalList(query) {
  return request({
    url: "/system/technician/normalList",
    method: "get",
    params: query,
  });
}
export function fetchReference(params) {
  return request({
    url: "/system/technician/normalList",
    method: "get",
    params,
  });
}

export function getCardPerson(params) {
  return request({
    url: "/system/zy/user/list",
    method: "get",
    params,
  });
}

//赠送优惠券
export function giveUserCoupon(data) {
  return request({
    url: "/system/userCoupon/giveUserCoupon ",
    method: "post",
    data: data,
  });
}

// 会员卡使用记录
export function getConsumptionCludes(params) {
  return request({
    url: "/system/member/record",
    method: "get",
    params,
  });
}
// 会员卡使用记录
export function chenData(data) {
  return request({
    url: "/system/member/chenData",
    method: "post",
    data: data,
  });
}
